<link rel="stylesheet" href="<{$xoops_url}>/modules/xanhte/css/prototype_window_class/themes/alert.css" type="text/css">
<link rel="stylesheet" href="<{$xoops_url}>/modules/xanhte/css/prototype_window_class/themes/default.css" type="text/css">
<script type="text/javascript" src="<{$xoops_url}>/modules/xanhte/js/lib/prototype.js"></script>
<script type="text/javascript" src="<{$xoops_url}>/modules/xanhte/js/lib/window.js"></script>
<script type="text/javascript" src="<{$xoops_url}>/modules/xanhte/js/lib/effects.js"></script>
<script>
function showADhtml(adid)
{
    Dialog.alert(
	  {
	    url:"../index.php",
	    options:
		  {
		    method:"get",
			parameters:"action_admanage_custom=1&ad_id="+adid
		  }
	  },
	  {
		windowParameters: {width:450, height:300},
		okLabel: "<{$smarty.const._CLOSE}>",
		ok:function(win) {return true;}
	  });
}
</script>
<h3><{$smarty.const._MI_AD_AD_MANAGE}></h3>
<br>
<{$smarty.const._MI_AD_AD_NUM_IS|sprintf:$app.ads.0}><br>
<ul class="toptab">
	<li><a href="<{$xoops_url}>/modules/<{$app.dirname}>/admin/?action_admin_admanage_advertise_edit=1"><{$smarty.const._MI_AD_AD_NEW}></a></li>
</ul>

<form action="./index.php" method="get">
<input type="hidden" name="action_admin_admanage_advertise" value="1">
<div><{$smarty.const._MI_AD_AD_GREP_SHOW}></div>
<table class="outer">
<tbody>
<tr class="even">
<td><{$smarty.const._MI_AD_AF_ad_clid}></td><td><{form_input name="ad_clid"}></td></tr>
<tr class="odd">
<td><{$smarty.const._MI_AD_AD_TYPE}></td><td><{form_input name="ad_type"}></td></tr>
<tr class="even">
<td><{$smarty.const._MI_AD_AD_STATUS}></td><td><{form_input name="ad_status"}></td></tr>
<tr class="odd">
<td colspan="2"><input type="submit" value="<{$smarty.const._SUBMIT}>"></td></tr>
</tbody>
</table>
</form>
<br>
<table width="100%" cellspacing="1" class="outer">
	<tr class="head">
		<th>ID</th>
		<th><{$smarty.const._MI_AD_AF_ad_clid}></th>
		<th><{$smarty.const._MI_AD_AF_ad_type}></th>
		<th><{$smarty.const._MI_AD_ADNAME}></th>
		<th><{$smarty.const._MI_AD_AF_ad_span}></th>
		<th align="center"><{$smarty.const._MI_AD_AD_LIMIT_PV_CLI}><br>----<br><{$smarty.const._MI_AD_AD_SHOWN}>(PV/CLI)</th>
		<th><{$smarty.const._MI_AD_ADSTATUS_VALID}></th>
		<th><{$smarty.const._MI_AD_AD_CURRENT_STATUS}></th>
		<th><{$smarty.const._MI_AD_CLIENT_CTIME}></th>
		<th colspan="3" align="center"><{$smarty.const._EDIT}></th>
	</tr>
<{foreach from=$app.ads.1 item=ad}>
<tr class="<{cycle values="even,odd"}>">
	<td><{$ad.ad_id}></td>
	<td>
		<a href="./?action_admin_admanage_clients_edit=1&amp;adcl_id=<{$ad.ad_clid}>"><{$ad.ad_client_name}></a>
	</td>
	<td>
		<{$ad.ad_type_str}><br>
		<{if $ad.ad_type==$smarty.const.STVAD_TYPE_XBLOCK}><a href="javascript:showADhtml(<{$ad.ad_id}>);"><br>[<{$smarty.const._MI_AD_AD_XBLOCK_GETHTML}>]</a><{/if}>
		<{if $ad.ad_type==$smarty.const.STVAD_TYPE_BANNER}><input type="text" style="width:90%" value="&lt;{$admanage.<{$ad.ad_variable}>}&gt;" onclick="this.select();"><{/if}>
	</td>
	<td><{$ad.ad_name}></td>
	<td align="center">
		From:<{"y-m-d"|date:$ad.ad_start}><br>
		To:<{"y-m-d"|date:$ad.ad_stop}>
	</td>
	<td align="center">
		<{$ad.ad_show_max}>/<{$ad.ad_click_max}>
		<br>----<br>
		<{$ad.ad_show_num}>/<{$ad.ad_click_num}>
	</td>
	<td>
		<{if $ad.ad_status==0}><span class="bg1"><{$smarty.const._MI_AD_ADSTATUS_INVALID}></span>
		<{else}><span class="bg3"><{$smarty.const._MI_AD_ADSTATUS_VALID}></span>
		<{/if}>
	</td>	
	<td>
		<{if $ad.ad_is_active==0}><span class="bg1"><{$smarty.const._MI_AD_AD_SHOW_OUT}></span>
		<{else}><span class="bg3"><{$smarty.const._MI_AD_AD_SHOW_IN}></span>
		<{/if}>
	</td>	
	<td><{"y-m-d H:i"|date:$ad.ad_regtime}></td>
	<td><a href="./?action_admin_admanage_advertise_edit=1&amp;ad_id=<{$ad.ad_id}>"><{$smarty.const._EDIT}></a></td>
	<td><a href="./?action_admin_admanage_advertise_delete=1&amp;ad_id=<{$ad.ad_id}>"><{$smarty.const._DELETE}> </a></td>
	<td align="center">
		<form action="./index.php" method="post" name="flip<{$ad.ad_id}>">
		<input type="hidden" name="action_admin_admanage_advertise_flip" value="1">
		<input type="hidden" name="ad_id" value="<{$ad.ad_id}>">
		<input type="button" value="<{if $ad.ad_status}><{$smarty.const._MI_AD_ADSTATUS_INVALID_DO}><{else}><{$smarty.const._MI_AD_ADSTATUS_VALID_DO}><{/if}>" onclick="if(confirm('<{$smarty.const._MI_AD_AD_THIS_AD_IS}><{if $ad.ad_status}><{$smarty.const._MI_AD_ADSTATUS_INVALID}><{else}><{$smarty.const._MI_AD_ADSTATUS_VALID}><{/if}><{$smarty.const._MI_AD_AD_IS_OK}>')){document.flip<{$ad.ad_id}>.submit();}"><{$app_ne.hidden}></form>
		<form action="./index.php" method="post" name="reset<{$ad.ad_id}>">
		<input type="hidden" name="ad_id" value="<{$ad.ad_id}>">
		<input type="hidden" name="action_admin_admanage_advertise_reset" value="1">
		<input type="button" value="<{$smarty.const._MI_AD_AD_RESET_DATA}>" onclick="if(confirm('<{$smarty.const._MI_AD_AD_RESET_DATA_DESC}>')){document.reset<{$ad.ad_id}>.submit();}"><{$app_ne.hidden}></form>
	</td>
</tr>
<{/foreach}>
</table>